package com.my.controller;


import com.my.domain.vo.ComplainVO;
import com.my.domain.vo.TempVO;
import com.my.result.Result;
import com.my.service.ComplainService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
/**
 * 投诉表(Complain)表控制层
 *
 * @author makejava
 * @since 2022-04-15 19:57:06
 */
@RestController
@RequestMapping("/complain")
public class ComplainController{

    @Resource
    private ComplainService complainService;

    @PostMapping("/list")
    private Result getComplainList(@RequestParam(defaultValue = "1") Integer currentPage){
        System.out.println("============+++++++++++++++++++++++++++++"+currentPage);
        return complainService.getComplainList(currentPage);
    }

    @GetMapping("/delete")
    public Result deleteById(@RequestParam Long id){
        return complainService.deleteComplainById(id);
    }
    @GetMapping("/add")
    public Result addComplain(@RequestParam Long id, @RequestParam String content ){
        System.out.println(content+"======================================complaincontroller");
       return complainService.addComplain(id,content);

    }
}

